package com.learning.security.dal.mysql;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.learning.security.dal.dataobject.AdminApiDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * <p>
 * 接口URI表 Mapper 接口
 * </p>
 *
 * @author xxx
 * @since 2024-10-04
 */
@Mapper
public interface AdminApiMapper extends BaseMapper<AdminApiDO> {

    default AdminApiDO getApiByPath(String requestURI) {
        LambdaQueryWrapper<AdminApiDO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(AdminApiDO::getPath, requestURI);
        return selectOne(queryWrapper);
    }
}
